const Router = require('koa-router')
const { verifyToken } = require('../../middleware/verify.middleware')
const { handlePassword } = require('../../middleware/password.middleware')
const { login, authLogin } = require('./auth.controller')
const authRouter = new Router({ prefix: "/auth" })

// 账号密码登录
authRouter.post('/login', handlePassword, login)

// token自动登录
authRouter.get('/authLogin', verifyToken, authLogin)

module.exports = authRouter
